package com.ruoyi.video.common;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 常量类
 * @Author: orange
 * @CreateTime: 2025-01-16
 */
public class MediaConstant {
    // 服务器名称
    public static String serverName = "EasyMedia";
    // 线程池
    public static ThreadPoolExecutor threadpool;
    // ffmpeg路径键
    public static String ffmpegPathKey;

    // 构造方法
    public MediaConstant() {
    }

    // 静态代码块，初始化线程池和ffmpeg路径键
    static {
        // 创建线程池，核心线程数为20，最大线程数为500，线程空闲时间60秒，任务队列使用LinkedBlockingDeque，拒绝策略为CallerRunsPolicy
        threadpool = new ThreadPoolExecutor(20, 500, 60L, TimeUnit.SECONDS, new LinkedBlockingDeque(), new ThreadPoolExecutor.CallerRunsPolicy());
        // ffmpeg路径键
        ffmpegPathKey = "EasyMediaFFmpeg";
    }
}
